import {RadarStatus, RadarTextColor} from '../api/types/radar.ts'

export const radarTextMap = {
  [RadarStatus.normal]: '正常',
  [RadarStatus.abnormal]: '离线',
  [RadarStatus.unbound]: '未绑定',
}
export const radarColorMap = {
  [RadarStatus.normal]: RadarTextColor.normal,
  [RadarStatus.abnormal]: RadarTextColor.abnormal,
  [RadarStatus.unbound]: RadarTextColor.unbound,
}

export const useRadarStatus = (status: RadarStatus = 2) => {
  return {
    text: radarTextMap[status],
    color: radarColorMap[status],
  }
}
